﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TanmiaGrp.Basis;

namespace TanmiaGrp.GeneralLedger.Core
{
    /// <summary>
    /// Specify the search specification.
    /// </summary>
    public class SearchSpecification : NotificationObject
    {
        #region Private Fields

        private string interactiveSearch;
        private bool showIsDisabled;
        private int pageIndex;
        #endregion

        #region Public Properties

        /// <summary>
        /// the text which will be used to search in all columns of entities.
        /// </summary>
        public string InteractiveSearch
        {
            get { return interactiveSearch; }
            set
            {
                if (interactiveSearch != value)
                {
                    interactiveSearch = value;
                    RaisePropertyChanged(() => InteractiveSearch);
                }
            }
        }

        /// <summary>
        /// Determine if IsNotActive entities will be retrieved or not.
        /// </summary>
        public bool ShowIsDisabled
        {
            get { return showIsDisabled; }
            set
            {
                if (showIsDisabled != value)
                {
                    showIsDisabled = value;
                    RaisePropertyChanged(() => ShowIsDisabled);
                }
            }
        }

        /// <summary>
        /// Page index to be retrieved after applying all filter criteria
        /// </summary>
        public int PageIndex
        {
            get { return pageIndex; }
            set
            {
                if (pageIndex != value)
                {
                    pageIndex = value;
                    RaisePropertyChanged(() => PageIndex);
                }
            }
        }
        #endregion

        #region Account Specifications
        private int? parentAccountID;

        public int? ParentAccountID
        {
            get { return parentAccountID; }
            set
            {
                if (parentAccountID != value)
                {
                    parentAccountID = value;
                    RaisePropertyChanged(() => ParentAccountID);
                }
            }
        }


        #endregion Account Specifications
    }
}
